from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
from django.contrib import admin
from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_list

from ProyectoAnimeToones.app.models import *
admin.autodiscover()

from app.forms import DatosExtraForm
tip_dict = {
    'model': Link,
    'template_object_name': 'tip',
    'slug_field': 'slug',
    'allow_xmlhttprequest': 'true',
}

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'TallerLoginLAGL.views.home', name='home'),
    # url(r'^TallerLoginLAGL/', include('TallerLoginLAGL.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', 'app.views.index'),
    url(r'^login/$', 'app.views.loguear'),
    url(r'^logout/$', 'app.views.logout_view'),
    url(r'^topten/$', 'app.views.topten'),
    url(r'^todosanime/$', 'app.views.todosanime'),
    url(r'^agregarlink/$', 'app.views.agregarlink'),
    url(r'^detalleanime/(.*)/$', 'app.views.detail'),
    url(r'^todosanime/(.*)/votar/$', 'app.views.votar'),
    url(r'^search/$', 'app.views.search'),
    url(r'^accounts/register/$', 'registration.views.register', {'backend': 'custom_backend.CustomBackend', 'form_class': DatosExtraForm}, name='registration_register'),
    url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
    url(r'^accounts/', include('registration.backends.default.urls')),
    url(r'^error/$', 'app.views.errorLogin'),


)
